import os
import sys
log_files = [
        '/var/log/magic.actions.server.log',
        '/var/log/longop.log',
        '/var/log/shortop.log',
        '/var/log/client.log',
]
if sys.argv[1] == 'clean':
    for logf in log_files:
        if os.path.exists(logf):
            cmd = 'rm %s' % logf
            print cmd
            os.system(cmd)
elif sys.argv[1] == 'pack':
    all_file = []
    for logf in log_files:
        if os.path.exists(logf):
            all_file.append(logf)
    os.system('tar cvf log.tar.bz2 %s' % ' '.join(all_file))


